package com.example.win.android_banduyujia.peopleactivity.activity.activity.openactivity.DataActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ExpandableListView;

import com.example.win.android_banduyujia.R;
import com.example.win.android_banduyujia.peopleactivity.adapter.ExpandableListViewAdapter;
import com.example.win.android_banduyujia.peopleactivity.ui.activity.BaseTitleBarActivity;

/**
 * Created by Win on 2015/9/6.
 */
public class TeachingscopeActivity extends BaseTitleBarActivity{
    public static final String TAG = TeachingscopeActivity.class.getSimpleName();

    private ExpandableListView  mExpandableListView;
    private ExpandableListViewAdapter mExpandableListViewAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.layout_teaching_scope_page);

        InitTitles();
        InitViews();
    }

    private void InitTitles() {
        showLeftBackButton();
        setTitle(R.string.layout_data_page_text_view_scope);
    }

    private void InitViews() {
        mExpandableListView=(ExpandableListView)findViewById(R.id.expandableListView);
        mExpandableListViewAdapter = new ExpandableListViewAdapter(this);
        mExpandableListView.setAdapter(mExpandableListViewAdapter);
        mExpandableListView.expandGroup(0);
        mExpandableListView.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() {
            @Override
            public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) {
                return false;
            }
        });
        mExpandableListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
            @Override
            public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
                Log.e(TAG, "groupPosition=" + groupPosition + ",childPosition=" + childPosition);

                return false;
            }
        });
    }
}
